<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>订单详情</title>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/shopcar.css"/>
    <link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/loading.css"/>
    <link rel="stylesheet" type="text/css" href="sourse/layer/mobile/need/layer.css">
	<link rel="stylesheet" href="/js/plugins/dialog/dialog.css"/>
    <script src="js/rem.js"></script>
	<script src="/js/jquery/jquery.min.js"></script>
	<script src="/js/bootstrap/js/bootstrap.min.js"></script>
	<script src="/js/plugins/jrender/jrender.js"></script>
	<script src="/js/plugins/dialog/dialog.min.js"></script>
	<script src="/js/common.js"></script>
	<script src="sourse/layer/mobile/layer.js"></script>
	<script type="text/javascript">
            var currentPage = 1;
            var pages;
            var travels;
            $(function () {

                var id = getParams().id;
                $(".loading").addClass("loader-chanage")
                $(".loading").fadeOut(300)

                //发送ajax请求,查询某个用户的订单
                $.get("/users/"+id+"/orders",function (data) {
                    //这里拿到的data是订单信息
                    //渲染订单
                    renderView(data);
                    pages=data.pages;
                    travels=data.list;
                });
                $(window).scroll(function () {
                    if(isEnd()){
                        if(currentPage<pages){
                            currentPage++;
                            $.get("/users/"+id+"/orders",{currentPage:currentPage,pageSize:6},function (data) {
                                $.merge(travels,data.list);
                                renderView({list:travels});
                            },"json");
                        }else{
                            $(document).dialog({
                                type:"notice",
                                infoText:"已经到底部了",
                                autoClose:1500,
                                position:"center"
                            });
                        }
                    }
                });

            });


            function renderView(data) {
                $(".travels").renderValues(data,{
                    handle:function (ele,value) {
                        $(ele).attr("href","/shop/orderdetail.html?id=" + value);
                    }
                })
            }


	</script>
</head>
<!--loading页开始-->
<div class="loading">
	<div class="loader">
        <div class="loader-inner pacman">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
	</div>
</div>
<!--loading页结束-->
	<body>
		<!--header star-->
		<header class="mui-bar mui-bar-nav" id="header">
			<a class="btn" href="javascript:history.go(-1)">
	            <i class="iconfont icon-fanhui"></i>
	        </a>
	        <h4>订单详情</h4>
	    </header>
	    <!--header end-->
	    
	    <div class="warp warptwo clearfloat travels">
	    	<div class="shopcar clearfloat" render-loop="list">
	    		<div class="list clearfloat fl">
	    			<div class="xuan clearfloat fl">
	    				<div class="radio" > 
						    <label>
						        <input type="checkbox" name="sex" value="" />
						    </label>
						</div>
	    			</div>
	    			<a render-key="list.productId" render-fun="handle">
		    			<div class="tu clearfloat fl">
		    				<span></span>
		    				<img render-src="list.coverUrl"/>
		    			</div>
		    			<div class="right clearfloat fl">
		    				<p class="tit over" render-html="list.productName"></p>
		    				<!--<p class="fu-tit over">颜色：蓝色  内存：120G</p>-->
							订单状态:<p class="tit over" render-html="list.stateName"></p>
		    				<p class="jifen over" render-html="list.integral"></p><p>积分</p>
		    				<div class="bottom clearfloat">
		    					<div class="zuo clearfloat fl">
		    						<ul>
		    							<li><img src="images/jian.jpg"/></li>
		    							<li>1</li>
		    							<li><img src="images/jia.jpg"/></li>
		    						</ul>
		    					</div>
		    					<i class="iconfont icon-lajixiang fr"></i>
		    				</div>
		    			</div>
	    			</a>
	    		</div>
	    	</div>
	    </div>
	    
	    <!--settlement end-->
	    
		<!--footer star-->
	    <footer class="page-footer fixed-footer" id="footer">
			<ul>
				<li>
					<a href="shop.html">
						<i class="iconfont icon-shouye"></i>
						<p>首页</p>
					</a>
				</li>
				<li>
					<a href="cation.html">
						<i class="iconfont icon-icon04"></i>
						<p>分类</p>
					</a>
				</li>
				<li class="active">
					<a href="shopcar.html">
						<i class="iconfont icon-gouwuche"></i>
						<p>购物车</p>
					</a>
				</li>
				<li>
					<a href="center.html">
						<i class="iconfont icon-yonghuming"></i>
						<p>我的</p>
					</a>
				</li>
			</ul>
		</footer>

	</body>

</html>
